lib/repo: Handle EACCES for POSIX locking
authorJonathan Lebon <jonathan@jlebon.com>
Tue, 30 Jun 2020 19:05:19 +0000 (15:05 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Tue, 30 Jun 2020 19:09:41 +0000 (15:09 -0400)
commit1d755f62af8bcd2c094324ddd3d591680d41726c
tree5895c25a469e506b78c7d1a7cff60334e9e8699d
parentfd8ecdf0476cf32d7970c8379c6010419b4235d3
lib/repo: Handle EACCES for POSIX locking

If `glnx_make_lock_file` falls back to `flock`, on NFS this uses POSIX
locks (`F_SETLK`). As such, we need to be able to handle `EACCES` as
well as `EAGAIN` (see `fnctl(2)`).

I think this is what coreos-ostree-importer has been hitting, which runs
on RHEL7 in the Fedora infra and does locking over an NFS share where
multiple apps could concurrently pull things into the repo.
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo.c